{% extends "admin/base_site_grid.html" %}

{% block tools %}{% include "common/snippet_follow.html" %}{{block.super}}{% endblock %}

{% block tabs %}{% tabs model %}{{block.super}}{% endblock %}

{% block extrahead %}{{block.super}}
<script>

// TODO demand column needs separate formatter for demand and forecasts

function probfmt(cellvalue, options, row)
{
  if (row['entity'] == 'material')
    var role = 'input/buffer';
  else if (row['entity'] == 'capacity')
    var role = 'input/resource';
  else if (row['entity'] == 'demand')
    var role = 'input/demand';
  else
    var role = 'input/operation';
  return $.jgrid.htmlEncode(cellvalue) + "<a href=\"" + url_prefix + "/detail/" + role
     + "/" + admin_escape(cellvalue) + "/\" onclick='event.stopPropatation()'><span class='ps-2 context fa fa-caret-right'></span></a>";
}

</script>
{% endblock %}

